package com.zx.cloud.controller;


import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.zx.cloud.ApiVersion;
import com.zx.cloud.RequestLogging;
import com.zx.cloud.model.response.ObjectDataResponse;
import com.zx.cloud.service.RepayOrderService;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @ClassName: QuartzController
 * @Description: 定时任务
 * @author: Administrator
 * @date: 2017年10月30日 下午4:18:37
 */
@RestController
@RequestMapping(value = ApiVersion.PROVIDER_V1_PREFIX+"/task")
public class TaskController{
	private static final Logger logger=Logger.getLogger(TaskController.class);
	@Autowired
	private RepayOrderService repayOrderService;
	
	@RequestLogging
	@ApiOperation(value = "贷后管理-逾期利息", notes = "贷后管理-逾期利息")
	@RequestMapping(value = "/buildOverdue", method = RequestMethod.POST)
	@ResponseBody
	public ObjectDataResponse<Integer> buildOverdue(){
		int success=repayOrderService.buildOverdue();
		return new ObjectDataResponse<Integer>(success);
	}
	@RequestLogging
	@ApiOperation(value = "代扣", notes = "代扣")
	@RequestMapping(value = "/withhold", method = RequestMethod.POST)
	@ResponseBody
	public ObjectDataResponse<Integer> withhold(){
		int   success= repayOrderService.withhold();
		return new ObjectDataResponse<Integer>(success);
	}
 }
